/*============================================================================*/
/*  Copyright (C) 2009-2014, iSOFT INFRASTRUCTURE SOFTWARE CO.,LTD.
 *  
 *  All rights reserved. This software is iSOFT property. Duplication 
 *  or disclosure without iSOFT written authorization is prohibited.
 *  
 *  @file       <Rte_Dcm.h>
 *  @brief      <>
 *  
 *  <MCU:TC1782>
 *  
 *  @author     <>
 *  @date       <2016-08-31 13:16:48>
 */
/*============================================================================*/


#ifndef RTE_DCM_H
#define RTE_DCM_H

#include "Dcm_Types.h"
#ifdef __cplusplus
extern "C" {
#endif  /* __cplusplus */

/********************* macro definition ********************/
#define DCM_DTRSTATUS_INVISIBLE 0x00 /* define for Xxx_GetDTRValue() function returned parameter (Status) */
#define DCM_DTRSTATUS_VISIBLE   0x01 /* define for Xxx_GetDTRValue() function returned parameter (Status) */

/********************* callback function for ECU Reset********************/
extern Std_ReturnType Rte_EcuReset(uint8 ResetType, Dcm_NegativeResponseCodeType* ErrorCode);

/**********call back functions called by DCM when a service request received******/
extern Std_ReturnType Rte_DcmServiceReqIndication(uint8 SID, uint8 *RequestData, uint16 DataSize);

/*******function for Protocol Start and stop***********/
extern Std_ReturnType  Rte_StartProtocol(Dcm_ProtocolType  ProtocolID);
extern Std_ReturnType  Rte_StopProtocol(Dcm_ProtocolType  ProtocolID);

/*************functions for session control service*****************/
extern Std_ReturnType Rte_DcmGetSessChgPermission(Dcm_SesType SesCtrlTypeActive, Dcm_SesType SesCtrlTypeNew);

extern Std_ReturnType Rte_DcmSessChgIndication(Dcm_SesType SesCtrlTypeActive, Dcm_SesType SesCtrlTypeNew);

/*************callback functions for DID services*************/
extern Std_ReturnType Rte_DidConditionCheckRead_1100(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType  Rte_DidConditionCheckRead_1101(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1103(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1104(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1105(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1106(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1107(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_110C(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_110D(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_110E(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_110F(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1110(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1111(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1112(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1113(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1114(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1116(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1117(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1118(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1119(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_111A(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_111C(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_111D(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_111E(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_111F(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1120(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1121(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1122(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1123(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1124(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1125(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1126(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1127(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1128(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1129(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_112A(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_112B(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_112C(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_112D(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_112E(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_112F(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1130(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1131(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1132(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1133(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1134(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1135(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1136(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1137(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1138(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1139(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_113A(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_113B(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_113D(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1140(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1141(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1142(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1143(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1144(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1145(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1146(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1147(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1148(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1149(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_114A(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_114B(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_114C(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_114D(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_114E(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_114F(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1150(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1151(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_1152(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_F182(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_F187(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_F18C(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_F192(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_F193(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_F194(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_F195(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType  Rte_DidConditionCheckRead_F199(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_0100(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_F19D(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_F1A0(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_F1A1(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_F198(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckRead_F190(Dcm_NegativeResponseCodeType* ErrorCode);

extern Std_ReturnType Rte_DidReadData_1100(uint8* data);
extern Std_ReturnType Rte_DidReadData_1101(uint8* data);
extern Std_ReturnType Rte_DidReadData_1103(uint8* data);
extern Std_ReturnType Rte_DidReadData_1104(uint8* data);
extern Std_ReturnType Rte_DidReadData_1105(uint8* data);
extern Std_ReturnType Rte_DidReadData_1106(uint8* data);
extern Std_ReturnType Rte_DidReadData_1107(uint8* data);
extern Std_ReturnType Rte_DidReadData_110C(uint8* data);
extern Std_ReturnType Rte_DidReadData_110D(uint8* data);
extern Std_ReturnType Rte_DidReadData_110E(uint8* data);
extern Std_ReturnType Rte_DidReadData_110F(uint8* data);
extern Std_ReturnType Rte_DidReadData_1110(uint8* data);
extern Std_ReturnType Rte_DidReadData_1111(uint8* data);
extern Std_ReturnType Rte_DidReadData_1112(uint8* data);
extern Std_ReturnType Rte_DidReadData_1113(uint8* data);
extern Std_ReturnType Rte_DidReadData_1114(uint8* data);
extern Std_ReturnType Rte_DidReadData_1116(uint8* data);
extern Std_ReturnType Rte_DidReadData_1117(uint8* data);
extern Std_ReturnType Rte_DidReadData_1118(uint8* data);
extern Std_ReturnType Rte_DidReadData_1119(uint8* data);
extern Std_ReturnType Rte_DidReadData_111A(uint8* data);
extern Std_ReturnType Rte_DidReadData_111C(uint8* data);
extern Std_ReturnType Rte_DidReadData_111D(uint8* data);
extern Std_ReturnType Rte_DidReadData_111E(uint8* data);
extern Std_ReturnType Rte_DidReadData_111F(uint8* data);
extern Std_ReturnType Rte_DidReadData_1120(uint8* data);
extern Std_ReturnType Rte_DidReadData_1121(uint8* data);
extern Std_ReturnType Rte_DidReadData_1122(uint8* data);
extern Std_ReturnType Rte_DidReadData_1123(uint8* data);
extern Std_ReturnType Rte_DidReadData_1124(uint8* data);
extern Std_ReturnType Rte_DidReadData_1125(uint8* data);
extern Std_ReturnType Rte_DidReadData_1126(uint8* data);
extern Std_ReturnType Rte_DidReadData_1127(uint8* data);
extern Std_ReturnType Rte_DidReadData_1128(uint8* data);
extern Std_ReturnType Rte_DidReadData_1129(uint8* data);
extern Std_ReturnType Rte_DidReadData_112A(uint8* data);
extern Std_ReturnType Rte_DidReadData_112B(uint8* data);
extern Std_ReturnType Rte_DidReadData_112C(uint8* data);
extern Std_ReturnType Rte_DidReadData_112D(uint8* data);
extern Std_ReturnType Rte_DidReadData_112E(uint8* data);
extern Std_ReturnType Rte_DidReadData_112F(uint8* data);
extern Std_ReturnType Rte_DidReadData_1130(uint8* data);
extern Std_ReturnType Rte_DidReadData_1131(uint8* data);
extern Std_ReturnType Rte_DidReadData_1132(uint8* data);
extern Std_ReturnType Rte_DidReadData_1133(uint8* data);
extern Std_ReturnType Rte_DidReadData_1134(uint8* data);
extern Std_ReturnType Rte_DidReadData_1135(uint8* data);
extern Std_ReturnType Rte_DidReadData_1136(uint8* data);
extern Std_ReturnType Rte_DidReadData_1137(uint8* data);
extern Std_ReturnType Rte_DidReadData_1138(uint8* data);
extern Std_ReturnType Rte_DidReadData_1139(uint8* data);
extern Std_ReturnType Rte_DidReadData_113A(uint8* data);
extern Std_ReturnType Rte_DidReadData_113B(uint8* data);
extern Std_ReturnType Rte_DidReadData_113D(uint8* data);
extern Std_ReturnType Rte_DidReadData_1140(uint8* data);
extern Std_ReturnType Rte_DidReadData_1141(uint8* data);
extern Std_ReturnType Rte_DidReadData_1142(uint8* data);
extern Std_ReturnType Rte_DidReadData_1143(uint8* data);
extern Std_ReturnType Rte_DidReadData_1144(uint8* data);
extern Std_ReturnType Rte_DidReadData_1145(uint8* data);
extern Std_ReturnType Rte_DidReadData_1146(uint8* data);
extern Std_ReturnType Rte_DidReadData_1147(uint8* data);
extern Std_ReturnType Rte_DidReadData_1148(uint8* data);
extern Std_ReturnType Rte_DidReadData_1149(uint8* data);
extern Std_ReturnType Rte_DidReadData_114A(uint8* data);
extern Std_ReturnType Rte_DidReadData_114B(uint8* data);
extern Std_ReturnType Rte_DidReadData_114C(uint8* data);
extern Std_ReturnType Rte_DidReadData_114D(uint8* data);
extern Std_ReturnType Rte_DidReadData_114E(uint8* data);
extern Std_ReturnType Rte_DidReadData_114F(uint8* data);
extern Std_ReturnType Rte_DidReadData_1150(uint8* data);
extern Std_ReturnType Rte_DidReadData_1151(uint8* data);
extern Std_ReturnType Rte_DidReadData_1152(uint8* data);
extern Std_ReturnType Rte_DidReadData_F182(uint8* data);
extern Std_ReturnType Rte_DidReadData_F187(uint8* data);
extern Std_ReturnType Rte_DidReadData_F18C(uint8* data);
extern Std_ReturnType Rte_DidReadData_F192(uint8* data);
extern Std_ReturnType Rte_DidReadData_F193(uint8* data);
extern Std_ReturnType Rte_DidReadData_F194(uint8* data);
extern Std_ReturnType Rte_DidReadData_F195(uint8* data);
extern Std_ReturnType Rte_DidReadData_F199(uint8* data);
extern Std_ReturnType Rte_DidReadData_0100(uint8* data);
extern Std_ReturnType Rte_DidReadData_F19D(uint8* data);
extern Std_ReturnType Rte_DidReadData_F1A0(uint8* data);
extern Std_ReturnType Rte_DidReadData_F1A1(uint8* data);
extern Std_ReturnType Rte_DidReadData_F198(uint8* data);
extern Std_ReturnType Rte_DidReadData_F190(uint8* data);

extern Std_ReturnType Rte_DidConditionCheckWrite_0100(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckWrite_F19D(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckWrite_F1A0(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckWrite_F1A1(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckWrite_F198(Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidConditionCheckWrite_F190(Dcm_NegativeResponseCodeType* ErrorCode);

extern Std_ReturnType Rte_DidWriteData_0100(uint8* data, uint16 dataLength, Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidWriteData_F19D(uint8* data, uint16 dataLength, Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidWriteData_F1A0(uint8* data, uint16 dataLength, Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidWriteData_F1A1(uint8* data, uint16 dataLength, Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidWriteData_F198(uint8* data, uint16 dataLength, Dcm_NegativeResponseCodeType* ErrorCode);
extern Std_ReturnType Rte_DidWriteData_F190(uint8* data, uint16 dataLength, Dcm_NegativeResponseCodeType* ErrorCode);







/******callback functions for Routine control**********/



/*******function for security access***********/
extern Std_ReturnType  Rte_GetSeed(uint8 *SecurityAccessRecord,uint8 *Seed,Dcm_NegativeResponseCodeType *ErrorCode);

extern Std_ReturnType  Rte_CompareKey(uint8 *key);

/*******function for OBD Server***********/

extern Std_ReturnType  Rte_RequestControl(uint8 tid,
		P2VAR(uint8, AUTOMATIC, RTE_VAR)inBuffer,
		P2VAR(uint8, AUTOMATIC, RTE_VAR)outBuffer);
		
extern Std_ReturnType  Rte_GetDTRValue00_tid00_00(P2VAR(uint16, AUTOMATIC, RTE_VAR)testVal,
        P2VAR(uint16, AUTOMATIC, RTE_VAR)minLimit,
        P2VAR(uint16, AUTOMATIC, RTE_VAR)maxLimit,
        P2VAR(uint8, AUTOMATIC, RTE_VAR)status);
extern Std_ReturnType  Rte_GetDTRValue(uint8 obdmid, uint8 testID, uint8 uaSid,
		P2VAR(uint16, AUTOMATIC, RTE_VAR)testVal,
		P2VAR(uint16, AUTOMATIC, RTE_VAR)minLimit,
		P2VAR(uint16, AUTOMATIC, RTE_VAR)maxLimit,
		P2VAR(uint8, AUTOMATIC, RTE_VAR)status); 
#ifdef __cplusplus
}
#endif  /* __cplusplus */

#endif /* RTE_DCM_H */
